package oop.ex3.sockets;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;

import oop.ex3.messages.FileContentMessage;

public class FMSocket extends ClientSocket {

	public FMSocket(InetSocketAddress dest) throws IOException,
			UnknownHostException {
		super(dest);
	}

	public void copyFile(FileContentMessage msg, File wantedFile) 
	throws IOException {
		FileOutputStream os = new FileOutputStream(wantedFile);
		for (int i = 0 ; i < msg.getSize() ; i++){
			os.write(_myDataIStream.read());
		}
		
		
	}
	

}
